<extend file='resource/admin/base'/>
<block name="content">
    <ul class="nav nav-tabs" role="tablist">
        <li ><a href="{{u(index)}}" >栏目管理</a></li>
        <li class="active"><a href="{{u(post)}}" >{{$oldData['cate_id']?'栏目编辑':'栏目添加'}}</a></li>

    </ul>
    <form action="" method="post" role="form">
        <legend>栏目管理</legend>

        <div class="form-group">
            <label for="">栏目名称</label>
            <input type="text" class="form-control" name="cate_name" id="" value="{{$oldData['cate_name']}}" placeholder="Input...">
        </div>
        
        <div class="form-group">
            <label for="">栏目排序</label>
            <input type="text" class="form-control" name="cate_sort" id="" value="{{$oldData['cate_sort']}}" placeholder="Input...">
        </div>
        <div class="form-group">
            <label for="">所属栏目</label>
            <select name="cate_pid" id="inputID" class="form-control">
                <option value="0"> -- 顶级栏目 -- </option>
                <foreach from="$cateData" value="$d" >
                    <option <if value="$oldData['cate_pid']==$d['cate_id']">selected</if>  value="{{$d['cate_id']}}"> -- {{$d['cate_name']}} -- </option>
                </foreach>
            </select>
        </div>
        <div class="form-group">
            <label for="">外链地址</label>
            <input type="text" class="form-control" name="cate_linkurl" value="{{$oldData['cate_linkurl']}}" id="" placeholder="Input...">
        </div>
        <div class="form-group">
            <label for="">栏目描述</label>
            <textarea class="form-control" name="cate_description">{{$oldData['cate_description']}}</textarea>
        </div>
        <button type="submit" class="btn btn-primary">Submit</button>
    </form>
</block>